package com.e3.basdoc.goods.client;

import com.e3.basdoc.goods.model.GoodsModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;
import com.google.gwt.user.client.Element;

public class GoodsEditorDialog extends TGFEditorDialog<GoodsModel> {
	
	private GoodsRPCServiceAsync service = GoodsRPCService.Util.getInstance();

	@Override
	protected void onRender(Element parent, int pos) {
		super.onRender(parent, pos);
		this.setSize(600, 550);
	}
	
	@Override
	public TGFFormPanel<GoodsModel> createFormPanel() {
		return new GoodsFormPanel();
	}

	@Override
	public void executeNewService(final GoodsModel model, GwtAsyncCallback<GoodsModel> callback) {
		service.newGoods(model, callback);
	}

	@Override
	public void executeModifyService(final GoodsModel model, GwtAsyncCallback<GoodsModel> callback) {
		service.modifyGoods(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return null;
	}

}
